package cn.edu.jxau.core;

import cn.edu.jxau.core.util.PropUtils;

import java.util.Properties;

/**
 * Desc:
 * ------------------------------------
 * Author:fulei04@meituan.com
 * Date:2017/12/15
 * Time:下午1:56
 */
public class Constant {

    public static final String BASE_PACKAGE;
    public static final String JDBC_DRIVER;
    public static final String JDBC_URL;
    public static final String JDBC_USERNAME;
    public static final String JDBC_PASSWORD;
    public static final String JSP_BASE_PATH;
    public static final String ASSET_BASE_PATH;
    public static final int UPLOAD_LIMIT;

    static {

        Properties prop = PropUtils.load("iFrame.properties");

        BASE_PACKAGE = PropUtils.getString(prop, "basePackage", null);

        JDBC_DRIVER = PropUtils.getString(prop, "jdbc.driver", null);
        JDBC_URL = PropUtils.getString(prop, "jdbc.url", null);
        JDBC_USERNAME = PropUtils.getString(prop, "jdbc.username", null);
        JDBC_PASSWORD = PropUtils.getString(prop, "jdbc.password", null);

        JSP_BASE_PATH = PropUtils.getString(prop, "jspBasePath", null);

        ASSET_BASE_PATH = PropUtils.getString(prop, "assetBasePath", null);

        UPLOAD_LIMIT = PropUtils.getInt(prop, "uploadLimit", null);
    }

    private Constant() {
        throw new UnsupportedOperationException("你为何要实例化Constant呢?");
    }
}
